// 函数组合的调试
// NERVER SAY DIE  --> nerver-say-die
const _ = require('lodash');

const split = _.curry((seq, str) => _.split(str, seq));
const join = _.curry((seq, array) => _.join(array, seq));
const map = _.curry((fn, array) => _.map(array ,fn));
const trace = _.curry((tag, v) => {
  console.log(tag, v);
  return v;
})
const f = _.flowRight(join('-'), trace('map'), map(_.toLower), trace('split'), split(' '));

console.log(f('NERVER SAY DIE'));